package com.zjdiepu.www.model.base.dto;

import javax.validation.GroupSequence;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

import com.zjdiepu.www.base.annotation.Add;
import com.zjdiepu.www.base.annotation.Update;
import com.zjdiepu.www.base.core.BaseModel;

/**
 * 菜单表<br/>
 * @author xiongxiaotun<br/>
 * @time 2017年04月05日 15时24分<br/>
 * @since 1.0<br/>
 */
@GroupSequence({Update.class, Add.class, SysPower.class})
public class SysPower extends BaseModel {
	
	private static final long serialVersionUID = 1L;
	/**
	 * 父级编号
	 */
	@NotBlank(message="父级菜单{message.blank}", groups={Update.class, Add.class})
	private String parentId;
	
	/**
	 * 权限编码
	 */
	@NotBlank(message="权限编码{message.blank}", groups={Update.class, Add.class})
	private String powerCode;
	
	/**
	 * 权限名称
	 */
	@NotBlank(message="权限名称{message.blank}", groups={Update.class, Add.class})
	private String name;
	
	/**
	 * 菜单(1：菜单  2：不是)
	 */
	@NotNull(message="请选择是否是菜单", groups={Update.class, Add.class})
	private Integer menuStatus;
	
	/**
	 * 快捷方式（1：是  2：不是）
	 */
	@NotNull(message="请选择是否是快捷方式", groups={Update.class, Add.class})
	private Integer quick;
	
	/**
	 * 连接
	 */
	private String href;
	
	/**
	 * 图标
	 */
	private String icon;
	
	public String getParentId(){
		return this.parentId;
	}
	
	public void setParentId(String parentId){
		this.parentId = parentId;
	}

	public String getPowerCode(){
		return this.powerCode;
	}
	
	public void setPowerCode(String powerCode){
		this.powerCode = powerCode;
	}

	public String getName(){
		return this.name;
	}
	
	public void setName(String name){
		this.name = name;
	}

	public Integer getMenuStatus(){
		return this.menuStatus;
	}
	
	public void setMenuStatus(Integer menuStatus){
		this.menuStatus = menuStatus;
	}

	public Integer getQuick(){
		return this.quick;
	}
	
	public void setQuick(Integer quick){
		this.quick = quick;
	}

	public String getHref(){
		return this.href;
	}
	
	public void setHref(String href){
		this.href = href;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}
	

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SysPower other = (SysPower) obj;
		if (getId() == null) {
			if (other.getId() != null)
				return false;
		} else if (!getId().equals(other.getId()))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "SysPower [parentId=" + parentId + ", powerCode=" + powerCode
				+ ", name=" + name + ", menuStatus=" + menuStatus + ", quick="
				+ quick + ", href=" + href + ", icon=" + icon + "]";
	}
}